package com.ruoyi.shop.member.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.member.mapper.ShopMemberPointMapper;
import com.ruoyi.shop.member.domain.ShopMemberPoint;
import com.ruoyi.shop.member.service.IShopMemberPointService;

/**
 * 会员积分Service业务层处理
 * 
 * @author xuxiang
 */
@Service
public class ShopMemberPointServiceImpl implements IShopMemberPointService {
	@Autowired
	private ShopMemberPointMapper shopMemberPointMapper;

	/**
	 * 查询会员积分
	 * 
	 * @param pointId 根据主键查询
	 * @return 会员积分
	 */
	@Override
	public ShopMemberPoint selectPointById(Long pointId) {
		return shopMemberPointMapper.selectPointById(pointId);
	}

	/**
	 * 查询会员积分列表
	 * 
	 * @param shopMemberPoint 会员积分
	 * @return 会员积分
	 */
	@Override
	public List<ShopMemberPoint> selectPointList(ShopMemberPoint shopMemberPoint) {
		return shopMemberPointMapper.selectPointList(shopMemberPoint);
	}

	/**
	 * 新增会员积分
	 * 
	 * @param shopMemberPoint 会员积分
	 * @return 结果
	 */
	@Override
	public int insertPoint(ShopMemberPoint shopMemberPoint) {
		shopMemberPoint.setCreateTime(DateUtils.getNowDate());
		return shopMemberPointMapper.insertPoint(shopMemberPoint);
	}

	/**
	 * 修改会员积分
	 * 
	 * @param shopMemberPoint 会员积分
	 * @return 结果
	 */
	@Override
	public int updatePoint(ShopMemberPoint shopMemberPoint) {
		return shopMemberPointMapper.updatePoint(shopMemberPoint);
	}

}
